package com.weihong.it.edi.controller;

import com.weihong.it.edi.pojo.User;
import com.weihong.it.edi.service.mysql.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 对userController 处理与User相关业务
 *
 * @author muxiaoyu
 * @create 2017-02-20 13:40
 **/
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/findAllUser.json")
    @ResponseBody
    public List<User> findAllUser(){
        List<User> userList=userService.findAllUser();
        return userList;
    }
    @RequestMapping("/findUserlistByPage.json")
    @ResponseBody
    public List<User> findUserListByPage(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize){
        List<User> list=userService.findUserListByPage(pageNum,pageSize);
        return list;
    }
}
